/*
 * Copyright (c) 2010-2013 Ruben Chakhmakhchyan. All rights reserved.
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Eclipse Public License
 * Version 1.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://opensource.org/licenses/EPL-1.0 and read it before using this file.
 */

#pragma once


#include "commontypes.h"
#include "wiacommon.h"
#include "image_site.h"



class CWiaTransferCallback : public IWiaTransferCallback//, public IWiaAppErrorHandler
{
public:
	CWiaTransferCallback( ImageSite* pImageSite );
	//~CWiaTransferCallback() {}

public: // IUnknown interface implementation

	STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppvObj);
	STDMETHOD_(ULONG, AddRef)();
	STDMETHOD_(ULONG, Release)();

public: // IWiaTransferCallback interface implementation

	STDMETHOD(TransferCallback)(LONG lFlags, WiaTransferParams *pWiaTransferParams);
	STDMETHOD(GetNextStream)(LONG lFlags, BSTR bstrItemName, BSTR bstrFullItemName, IStream **ppDestination);

/*
public: // IWiaAppErrorHandler

	STDMETHOD(GetWindow)(HWND *phwnd);
	STDMETHOD(ReportStatus)(LONG lFlags, IWiaItem2 *pWiaItem2, HRESULT hrStatus, LONG lPercentComplete);
*/
private:

	LONG m_refCount; // reference count

	// image site
	ImageSite* m_pImageSite;

	IStream* m_pStream; // memory stream for data transfer
	HGLOBAL m_hGlobal; // global handle to stream buffer
};
